#include "BuildTransportship.hh"

using namespace Geom;

TASK_DEF(BuildTransportship, 50000, 50000)

void Planet::BuildTransportship::build(Planet& planet, u8 itemCount) {
    spPlayer owner = planet.get_owner();
    Vector<> pos = planet.get_star()->position;
    spFleet closestFleet = owner->get_closest_fleet(pos);

    if (closestFleet.isNull())
        closestFleet = owner->add_fleet(pos, 0, 0, itemCount, 0, 0);
    else
        closestFleet->add_transportship(itemCount);
}
